import axios from "./axios";

// 通过 ip 地址查询所在城市
export const getCitysByip = ()=>{
    return axios({
        url:'/ip?ip=221.13.21.194&key=b246d3d6954ef868e6b9af454d7ad5c2',
        method:'get',
    })
}

// 通过城市名查询adcode
export const getAdcodeBycity = (city)=>{
    return axios({
        url:`/geocode/geo?address=${city}&key=b246d3d6954ef868e6b9af454d7ad5c2`,
        method:'get',
    })
}

// 通过adcode查询城市天气(base返回实况天气)
export const getWeatherByadcodeb = (adcode)=>{
    return axios({
        url:`/weather/weatherInfo?city=${adcode}&key=b246d3d6954ef868e6b9af454d7ad5c2&extensions=base`,
    })
}

// 通过adcode查询城市天气(all返回预报天气)
export const getWeatherByadcodea = (adcode)=>{
    return axios({
        url:`/weather/weatherInfo?city=${adcode}&key=b246d3d6954ef868e6b9af454d7ad5c2&extensions=all`,
    })
}
